package edu.tsinghua.ddb.main.console;

import java.text.SimpleDateFormat;
import java.util.Date;

import edu.tsinghua.ddb.util.Conf;

public class MyLog {
	
	private static boolean inDebugLevel() {
		return Conf.get("logLevel").equalsIgnoreCase("debug");
	}

	private static SimpleDateFormat sdf = new SimpleDateFormat("MM-dd HH:mm:ss");

	public static void debug(Object s) {
		if (inDebugLevel())
			print(s);
	}

	public static void info(Object s) {
		print(s);
	}

	private static void print(Object s) {
		System.out.println(sdf.format(new Date()) + " " + s);
	}

}
